This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
~Karl Zenaverobu 19.Jan.04 11:03 AM a Web browser Notes Client All Releases All Platforms
The users submit a file attachment on the web via a file upload control. All I am trying to do on the client is get the attachment from $file and move it to my rich text field on the form (purely for display purposes).
Following it in the debugger I get hold of everything but a messagebox comes up saying the file "filename" could not be found (when I get to the line (Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, "", filestring), even though its there??
Any ideas
My full code is :
Dim s As New NotesSession
Dim ui As New notesuiworkspace
Dim doc As NotesDocument
Dim db As notesdatabase
Dim object As NotesEmbeddedObject
Dim filestring As String
Dim uidoc As notesuidocument
Set db=s.Currentdatabase
Set uidoc = ui.currentdocument
Set doc=uidoc.document
Dim item As notesitem
Dim rtitem As NotesRichTextItem
If doc.hasitem ("attachment") Then
Set rtitem=doc.getfirstitem("attachment")
Else
Set rtitem = doc.CreateRichTextItem( "attachment" )
End If
If doc.hasitem("$file") Then
Set item = doc.getfirstitem("$file")
Set notesEmbeddedObject = doc.GetAttachment( item.values(0) )
filestring = notesembeddedobject.name
Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, "", filestring)
End If